<?php
    // Is an admin connected ?
    if (isset($_SESSION['id']) && isset($_SESSION['isAdmin']) && $_SESSION['isAdmin'] === true)
    {
        require_once 'src/backoffice/model/model_table.php';
        if (isset($_GET['v']))
        {
            $value = $_GET['v'];
            if (tableExists($value, $db))
            {
                $tableInfos = getTableInfos($value, $db);
                require_once 'src/backoffice/view/view_table.php';
            }
            else
            {
                header('Location: index.php?p=backoffice');
            }
        }
    }
?>
